<?php

namespace App\Policies;

use App\Blogs;
use App\User;
use Illuminate\Auth\Access\HandlesAuthorization;

class BolgPolicy
{
    use HandlesAuthorization;

    /**
     * Create a new policy instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * 1.创建Policy 》》 php artisan make:policy BolgPolicy
     * 2.注册Policy 》》 在Providers下注册
     *
     */

    public function edit(Blogs $blogs, User $user)
    {

        return $blogs->user_id === $user->id;
    }

    public function delete(Blogs $blogs, User $user)
    {
        return $blogs->user_id === $user->id;
    }


}
